feat(api): add support for cloning from a component#18671
Draft
nijel wants to merge 2 commits intoWeblateOrg:mainfrom
Draft
feat(api): add support for cloning from a component#18671nijel wants to merge 2 commits intoWeblateOrg:mainfrom
nijel wants to merge 2 commits intoWeblateOrg:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds REST API capabilities to duplicate components and seed new translations based on existing components, plus extends auto-translation to accept multiple source components.
Changes:
- Add
from_componentsupport when creating components (duplicate configuration + seed translations/add-ons). - Add
from_componentsupport when creating translations (seed via auto-translation from one or more components). - Extend auto-translation plumbing from single
source_component_idtosource_component_ids.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| weblate/trans/tasks.py | Extends component post-save task inputs for seeding; updates auto-translate callsites to list-based sources. |
| weblate/trans/models/component.py | Adds transient seed settings and triggers seeding during after_save. |
| weblate/trans/management/commands/auto_translate.py | Updates management command to pass list-based component sources. |
| weblate/trans/component_seed.py | New module implementing snapshotting + seeding translations and cloning add-ons. |
| weblate/trans/autotranslate.py | Supports multiple source components and ordered preference behavior. |
| weblate/api/views.py | Adds serializer-based validation and translation seeding via auto-translation. |
| weblate/api/tests.py | Adds API tests covering component cloning and translation creation from components. |
| weblate/api/serializers.py | Adds component reference fields/resolution + from_component behavior in component/translation creation. |
| docs/changes.rst | Documents the new REST API from_component option. |
| docs/api.rst | Documents request parameters and examples for from_component. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
The latest updates on your projects. Learn more about Argos notifications ↗︎ Awaiting the start of a new Argos build… |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #10362